diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-12-20 17:11:37 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-12-20 17:11:37 +0000 |
| commit | bed3635d310d243a7946566e4eea0ed5e4833a49 (patch) | |
| tree | 13645f1d4ab2283cd8e8aceb2e836cebec9e2a98 /snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected | |
| parent | 02cb942ad9e1bd9dd6cb1083bd322ade3f83613e (diff) | |
Move ShidToPatio code to separate package
Diffstat (limited to 'snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected')
1 files changed, 91 insertions, 0 deletions
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected new file mode 100644 index 00000000..8f0b9f0f --- /dev/null +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -0,0 +1,91 @@ +Compilation unit elements: + +( + function-decl + "shed__runtime__gc_get_root_stack_index" + params=() + return-type=int +) +( + function-decl + "shed__runtime__gc_set_root_stack_index" + params=((param "gc_root_stack_index" int)) + return-type=void +) +( + function-decl + "shed__runtime__gc_push_root" + params=((param "gc_root" int)) + return-type=void +) +( + function-decl + "shed__runtime__gc_collect" + params=() + return-type=void +) +( + function + "shed__function__f__0" + visibility=private + locals=((param "closurePointer__0" data-ptr) (val "local__a" data-ptr) (val "local__b" data-ptr) (val "gcRootStackIndex__0" int)) + return-type=int + body=( + ( + memory-load + (local "local__a") + pointer=(local "closurePointer__0") + layout=(struct ((struct (data-ptr int int int)) (struct (function-ptr (struct ()) (struct (data-ptr data-ptr)))))) + offset=(1 2 0) + ) + ( + memory-load + (local "local__b") + pointer=(local "closurePointer__0") + layout=(struct ((struct (data-ptr int int int)) (struct (function-ptr (struct ()) (struct (data-ptr data-ptr)))))) + offset=(1 2 1) + ) + (call (local "gcRootStackIndex__0") "shed__runtime__gc_get_root_stack_index" ()) + (call _ "shed__runtime__gc_set_root_stack_index" ((local "gcRootStackIndex__0"))) + (call _ "shed__runtime__gc_push_root" ((local "local__a"))) + (call _ "shed__runtime__gc_collect" ()) + (return (local "local__a")) + ) +) + +Locals: + * (val "local__a" data-ptr) + * (val "local__b" data-ptr) + * (val "closure__f__0" int) + * (val "closurePointer__f__0" data-ptr) + +Instructions: + +( + (alloc-heap (local "closurePointer__f__0") (struct ((struct (data-ptr int int int)) (struct (function-ptr (struct ()) (struct (data-ptr data-ptr))))))) + ( + memory-store + pointer=(local "closurePointer__f__0") + layout=(struct ((struct (data-ptr int int int)) (struct (function-ptr (struct ()) (struct (data-ptr data-ptr)))))) + offset=(1 0) + value=(function-ptr "shed__function__f__0") + ) + ( + memory-store + pointer=(local "closurePointer__f__0") + layout=(struct ((struct (data-ptr int int int)) (struct (function-ptr (struct ()) (struct (data-ptr data-ptr)))))) + offset=(1 2 0) + value=(local "local__a") + ) + ( + memory-store + pointer=(local "closurePointer__f__0") + layout=(struct ((struct (data-ptr int int int)) (struct (function-ptr (struct ()) (struct (data-ptr data-ptr)))))) + offset=(1 2 1) + value=(local "local__b") + ) + (data-ptr-to-int (local "closure__f__0") (local "closurePointer__f__0")) +) + +Temporary stack: + * PatioLocalRef[name=closure__f__0] |
